<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/7/4 0004
 * Time: 17:46
 */

namespace app\admin\validate;


use think\Validate;

class Gear extends Validate
{
    protected $rule = [
        'data'  => '',
        'price' =>'require',
        'desc'  =>'require',
        'type'  =>'require|in:1,2,3',
        'expire'=>'requireIf:type,1,2',

    ];

    protected $message = [
        'price.require' =>'请输入价格',
        'desc.require'  =>'请输入描述',
        'type.require'  =>'请输入类型',
        'type.in'       =>'请选择正确的类型',
    ];

    protected $scene = [
        'gearlist'  =>  'data',
        'gearset'   =>  ['desc','price','type','expire'],
        'geardel'   =>  ['data'],
        'geardetail'=>  ['data'],

    ];
}